﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ControlTest
{
    public partial class Form1 : Form
    {
        private BufferedGraphics bufferedGraphics;
        public Form1()
        {
            InitializeComponent();

            bufferedGraphics = BufferedGraphicsManager.Current.Allocate(this.CreateGraphics(), this.DisplayRectangle);
            bufferedGraphics.Graphics.Clear(this.BackColor);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //this.CreateGraphics().DrawLine(Pens.Black,this.topologyNode1.Center,this.topologyNode1.Center);
            //this.CreateGraphics().DrawLine(Pens.Black, new Point(117, 178), new Point(379, 152));
            //bufferedGraphics.Graphics.DrawLine(new Pen(Color.Red,4.0F), topologyNode1.Center, topologyNode2.Center);
            //bufferedGraphics.Render();
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            //Point p1 = this.topologyNode1.Center;
            //Point p2 = this.topologyNode2.Center;
            
            //this.CreateGraphics().DrawLine(Pens.Black, p1, p2);
            
            bufferedGraphics.Render();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            this.autoTopology1.RefreshTopology();
        }

        private void button2_Click(object sender, EventArgs e)
        {
        }
    }
}
